<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div class="box">1</div>
    <script>
        // var ele = document.querySelector(".box");
        // var h1 = document.createElement("h1");
        // h1.innerHTML = "我是h1标签";


        // // ele.innerHTML = "<h1>我是innerHTML添加的</h1>";
        // // ele.innerHTML = h1;
        // // ele.appendChild("<h1>我是innerHTML添加的</h1>");
        // ele.appendChild(h1);

        var arr = [{
            name:"张三",
            age:20,
            gender:"男"
        },{
            name:"李四",
            age:22,
            gender:"男"
        },{
            name:"王五",
            age:21,
            gender:"女"
        }];

        // var arr = [1,3,2,5];
        arr.sort(function(a,b){
            return a.age-b.age;
        })
        console.log(arr);



    </script>
</body>
</html>